package router

import (
	jwt "gitee.com/sansaniot/ssiot-core/httpmvc/jwtauth"
	"github.com/gin-gonic/gin"
	processorApi "ssdevice/internal/rule/api"
)

func init() {
	RuleRouters = append(RuleRouters, processorRouter)
}

func processorRouter(r *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) {
	api := processorApi.Processor{}

	processor := r.Group("/api/rule/processor").Use(authMiddleware.MiddlewareFuncWithOutValidate())
	{
		processor.GET("/find", api.FindList)
		processor.GET("/get", api.Get)
		processor.POST("/add", api.Create)
		processor.POST("/modify", api.Modify)
		processor.POST("/remove", api.Remove)
	}
}
